perm filename TAPE.RPH[S,DOC]1 blob sn#002737 filedate 1972-10-09 generic text, type T, neo UTF8
STANFORD ARTIFICIAL INTELLIGENCE LABORATORY		NOVEMBER 1971
OPERATING NOTE 65
	








				TAPE
				 by
			RICHARD P. HELLIWELL






Abstract

TAPE is a program for reading non-standard magnetic tapes. One of its
saving  features is that it can determine density, parity, and length
of a given record with reasonable certainty.























This work was supported in part by the The Advanced Research Projects
Agency of the Department of Defense under Contract SD-183.

	To initialize TAPE type the following system level command:

		R TAPE<cr>

	The program will respond with:

		LOGICAL NAME OF MAGTAPE DRIVE?

	        If you type <cr> at this point logical MTA0  will  be
assumed.  The  program  will  type out the initial default parity and
density (record length is set to 0). Now you are in the command loop.
TAPE will type:

		COMMAND?

	At this point you may type one of the following commands:

	W	REWIND
	An	ADVANCE FILE
	Bn	BACKSPACE FILE
	ARn	ADVANCE FILE
	BRn	BACKSPACE FILE
	WEn	WRITE EOF
	WBn	WRITE 3" OF BLANK TAPE
	T	ADVANCE TO LOGICAL EOT
	SP	SET PARITY
	SDn	SET DENSITY TO n
	SLn	SET RECORD LENGTH(IN DECIMAL WORDS) TO n
	C	DETERMINE DENSITY, PARITY, AND LENGTH OF CURRENT RECORD
	CL	DETERMINE LENGTH OF CURRENT RECORD
	G	GO TO READ/WRITE LOOP
	?	PRINT THIS LIST

        where "n" refers to a positive decimal integer. Any operation
which  causes you to reach the physical end of tape or the load point
will indicate said condition.

An

	Advances over "n" end of files. This means that  if  you  are
anywhere in a file "A" will get you to the beginning of the next one.
"An" will get you to the beginning of the nth file after the  current
one.

Bn

	Does a backspace record, then backspaces over "n" end of file
marks,  and  if  not then at load point advances over the last end of
file. This means that if you are at the front of a file "Bn" backs up
to the front of the nth file before this one. However if you  are  in
the  middle  of  the file somewhere, you back up to the front of this
file and then backs up to the front of the  n-1th  file  before  this
one.

SP

        "SET  PARITY" will ask "WHAT PARITY?", to which you may reply
"ODD", "EVEN", or <cr> (default "ODD").

SD

        "SET  DENSITY" will set the tape density in BPI to "n", where
"n" is "200", "556", or "800". If "n"=0 TAPE will ask "WHAT DENSITY?"
and  then  read the number. <cr> at this point will get default "556"
BPI density.

SL

        "SET  RECORD  LENGTH"  works  similar  to  "SET DENSITY". Any
non-zero record length is legal (please use discretion).

C

        This  causes  TAPE to read the current record in all parities
and densities to determine what format the tape was  written  in.  If
the parity or density is not unique, you will be asked to specify the
parity or density. Then a "CL" is done.

CL

        The  current  record  is  read  twice to determine the record
length. The length in decimal and octal words is  printed,  any  read
errors are indicated.

G

        This command enters the TAPE read/write loop.  TAPE  responds
with:

		TAPE MODE(S)?

        To which  you  may  type  a  string  containing  any  of  the
following characters:

	?	PRINT THIS LIST
	$	<ALTMODE> GET OUT OF TAPE LOOP
	T	TOTAPE
	F	FROMTAPE
	E	EBCDIC CONVERSION
	B	BCD CONVERSION
	N	DELETE EVERYTHING FROM COLUMN 73 TO END OF LINE(FROMTAPE)
		IGNORE LINE NUMBERS AND PAGE MARKS(TOTAPE)
	C	CONVERT MULTIPLE SPACES TO TABS AND DELETE TRAILING SPACES
		(FROMTAPE ONLY)

?

        All other characters in the string are ignored and  the  list
is printed. TAPE then types "TAPE MODE(S)?" again.

$

        <altmode>  ignores  all  other  characters  and  returns   to
"COMMAND" loop.

        All other commands work as expected, any  conflict  of  modes
will cause "ILLEGAL MODES!" and "TAPE MODE(S)?" to be typed.

        If direction or conversion format are omitted,  the  defaults
"FROM  TAPE"  and "BCD" will be used. If the modes are legal they are
printed for you. TAPE then tries to calculate the probable number  of
chars  per card (from the record length). The probable card length is
printed or "NO PROBABLE CARD LENGTH" and  you  are  asked  "HOW  MANY
CHARS  PER CARD?". If you type <cr>, the probable card length will be
used., altmode gets you back to "COMMAND" level, otherwise the number
you type will be used.

        At this point you are asked for  the  disk  filename  (either
input  or  output).  A  standard  file  specification may be used (no
"*"'s). A null file spec gets you back to "COMMAND" level.

        Now  the  transfer takes place any errors will be referred to
you. At the end of the transfer you return to "COMMAND" level.

        Now  I will show a trial run, user responses will be shown in
lower case (which is legal input):




r tape<cr>
LOGICAL NAME OF MAGTAPE DRIVE?<cr>
DEFAULT MTA0
INITIAL DEFAULT: ODD PARITY 556 BPI!

COMMAND?w<cr>
AT LOAD POINT!

COMMAND?c<cr>
TAPE PARITY:EVEN
USING 800 BPI
14 (DECIMAL) 16 (OCTAL) WORDS PER RECORD

COMMAND?g<cr>
	TAPE MODE(S)?<cr>
	DEFAULT FROMTAPE
	DEFAULT BCD
	PROBABLY 84 CHARS PER CARD
	NUMBER OF CHARS PER CARD?<cr>
	OUTPUT FILENAME?foo.dat[1,foo]<cr>
<transfer takes place>
COMMAND?


Now wasn't that simple?